using System.Collections.Generic;
using System.Text;

namespace OracleInternal.SqlAndPlsqlParser.LocalParsing.Ansi
{
	internal class OracleLpAnsiCrossOuterApplyClauseCollectionExpression : OracleLpAnsiCrossOuterApplyClause
	{
		protected OracleLpCollectionExpression m_vCollectionExpression;

		protected List<OracleLpColumnDescriptor> m_vColumnDescriptors;

		public OracleLpCollectionExpression CollectionExpression
		{
			get
			{
				return m_vCollectionExpression;
			}
			set
			{
				m_vCollectionExpression = value;
				if (m_vCollectionExpression != null)
				{
					m_vCollectionExpression.Parent = this;
				}
			}
		}

		internal override List<OracleLpTablePrimary> TablePrimaryList
		{
			get
			{
				if (m_vTablePrimaryList == null)
				{
					m_vTablePrimaryList = new List<OracleLpTablePrimary>();
				}
				return m_vTablePrimaryList;
			}
		}

		public override List<OracleLpColumnDescriptor> ColumnDescriptors
		{
			get
			{
				if (m_vColumnDescriptors == null)
				{
					m_vColumnDescriptors = new List<OracleLpColumnDescriptor>();
				}
				return m_vColumnDescriptors;
			}
		}

		public OracleLpAnsiCrossOuterApplyClauseCollectionExpression(OracleLpFromListTerm ft)
			: base(ft)
		{
		}

		internal override void ToString(StringBuilder sb)
		{
			string depthIndent = base.DepthIndent;
			sb.Append(depthIndent);
			sb.Append("JoinType:  ");
			sb.Append(ClauseType);
			sb.Append("  CrossOuterApplyJoinType:  ");
			sb.Append(m_vType);
			sb.Append('\n');
			m_vCollectionExpression.ToString(sb);
		}
	}
}
